<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>分页</title>
</head>
<body>
<!--分页组件-->

    {% if post.has_previous  %}
        <button type="button" ><a href="/app02/book1.html?p={{ post.previous_page_number }}">上一页</a></button>
    {% else %}
        <button type="button" ><a href="#">上一页</a></button>
    {% endif %}
    {% for i in paginator.pre_page_range %}
        {% if i == current_page %}
            <a style="font-size: 30px" href="/app02/book1.html?p={{ i }}">{{ i }}</a>
        {% else %}
            <a href="/app02/book1.html?p={{ i }}">{{ i }}</a>
        {% endif %}
    {% endfor %}

    {% if post.has_next  %}
        <button type="button" ><a href="/app02/book1.html?p={{ post.next_page_number }}">下一页</a></button>
    {% else %}
        <button type="button" ><a href="#">下一页</a></button>
    {% endif %}
        <span>{{ post.number }}/{{ post.paginator.num_pages }}</span>


    <nav aria-label="...">
        <ul class="pagination pagination-sm">
            {{ page_obj.page_str|safe }}
        </ul>
    </nav>

</body>
</html>